﻿@*
    Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
    Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
*@
@using TagHelperSample.Web.Models
@model IList<User>

<environment names="development">
    Hello, you're in Development
</environment>

<script src="~/originalXX.js" asp-fallback-src="~/fallback.js" asp-fallback-test="window.foo">
    // 1. By removing the src attribute, the script below will execute and prevent fallback from running
    // 2. Alternatively fix the type in the value of the src attribute
    function foo() {
        return 1;
    }

    function bar() {
        document.write("<p>foo is from page</p>");
    }
</script>

<script>bar();</script>

<h2>Index</h2>
@if (Model != null && Model.Count() != 0)
{
    <div class="form-horizontal">
        @for (var index = 0; index < Model.Count(); ++index)
        {
            <div class="form-group">
                <label asp-for="@Model[index].Name"></label>
                <input type="text" asp-for="@Model[index].Name" disabled="disabled" readonly="readonly" />
            </div>
            <div class="form-group">
                <label asp-for="@Model[index].DateOfBirth"></label>
                <input type="date" asp-for="@Model[index].DateOfBirth" asp-format="{0:yyyy-MM-dd}" disabled="disabled" readonly="readonly" />
            </div>
            <div class="form-group">
                <label asp-for="@Model[index].YearsEmployeed"></label>
                <input type="number" asp-for="@Model[index].YearsEmployeed" disabled="disabled" readonly="readonly" />
            </div>
            <div class="form-group">
                <label asp-for="@Model[index].Blurb"></label>
                <textarea rows="4" asp-for="@Model[index].Blurb" disabled="disabled" readonly="readonly"></textarea>
            </div>

            <p>
                <a asp-action="Edit" asp-route-id="@index">Edit</a>
            </p>
        }
    </div>
}
<p>
    <a asp-action="Create">Create New</a>
</p>
